package chapter14.exercise.none;

public class Position {
    private String title;
    private Person person;

    public Position(String title, Person person) {
        this.title = title;
        this.person = person;
        if (this.person == null)
            this.person = Person.Null;
    }

    public Position(String title) {
        this.title = title;
        this.person = Person.Null;
    }

    public String getTitle() {
        return this.title;
    }

    public void setTitle(String newTitle) {
        this.title = newTitle;
    }

    public Person getPerson() {
        return this.person;
    }

    public void setPerson(Person person) {
        this.person = person;
        if (this.person == null)
            this.person = Person.Null;
    }

    @Override
    public String toString() {
        return "Position [title=" + title + ", person=" + person + "]";
    }

}
